/**
 * Created by WLG on 2018/11/9.
 */
let serverConfig = require('../config/serverConfig');
/**
 * 所有socket请求处理器
 */
class MainSocketHandler{
    static init(io){
        this.nsp = io.of(serverConfig.socketNameSpace);
        this.nsp.on('connection', function(socket) {
            require('./systemSocketHandler').attach(io,socket);
            require('./chatSocketHandler').attach(io,socket);
        });

        this.nsp.on('connection', (socket) => {
            socket.on('error', (error) => {
                logError.error('socket error', error)
            });
        });
    }
}
module["exports"] = MainSocketHandler;